<?php

/**
 * OperadoresPrestamos form base class.
 *
 * @method OperadoresPrestamos getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseOperadoresPrestamosForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'concepto_cf_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => false)),
      'empresa_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'operador_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => false)),
      'financiamiento'  => new sfWidgetFormInputText(),
      'porcentaje'      => new sfWidgetFormInputText(),
      'concepto'        => new sfWidgetFormTextarea(),
      'monto'           => new sfWidgetFormInputText(),
      'monto_pagado'    => new sfWidgetFormInputText(),
      'monto_penalidad' => new sfWidgetFormInputText(),
      'fecha'           => new sfWidgetFormDate(),
      'dias'            => new sfWidgetFormInputText(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'concepto_cf_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'required' => false)),
      'empresa_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'operador_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'))),
      'financiamiento'  => new sfValidatorInteger(array('required' => false)),
      'porcentaje'      => new sfValidatorInteger(array('required' => false)),
      'concepto'        => new sfValidatorString(array('required' => false)),
      'monto'           => new sfValidatorNumber(array('required' => false)),
      'monto_pagado'    => new sfValidatorNumber(array('required' => false)),
      'monto_penalidad' => new sfValidatorNumber(array('required' => false)),
      'fecha'           => new sfValidatorDate(),
      'dias'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'      => new sfValidatorDateTime(),
      'updated_at'      => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('operadores_prestamos[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'OperadoresPrestamos';
  }

}
